package com.ruoyi.chatgpt.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.chatgpt.mapper.GptTariffPackageMapper;
import com.ruoyi.chatgpt.domain.GptTariffPackage;
import com.ruoyi.chatgpt.service.IGptTariffPackageService;

/**
 * packageService业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-29
 */
@Service
public class GptTariffPackageServiceImpl implements IGptTariffPackageService 
{
    @Autowired
    private GptTariffPackageMapper gptTariffPackageMapper;

    /**
     * 查询package
     * 
     * @param id package主键
     * @return package
     */
    @Override
    public GptTariffPackage selectGptTariffPackageById(Long id)
    {
        return gptTariffPackageMapper.selectGptTariffPackageById(id);
    }

    /**
     * 查询package列表
     * 
     * @param gptTariffPackage package
     * @return package
     */
    @Override
    public List<GptTariffPackage> selectGptTariffPackageList(GptTariffPackage gptTariffPackage)
    {
        return gptTariffPackageMapper.selectGptTariffPackageList(gptTariffPackage);
    }

    /**
     * 新增package
     * 
     * @param gptTariffPackage package
     * @return 结果
     */
    @Override
    public int insertGptTariffPackage(GptTariffPackage gptTariffPackage)
    {
        gptTariffPackage.setCreateTime(DateUtils.getNowDate());
        return gptTariffPackageMapper.insertGptTariffPackage(gptTariffPackage);
    }

    /**
     * 修改package
     * 
     * @param gptTariffPackage package
     * @return 结果
     */
    @Override
    public int updateGptTariffPackage(GptTariffPackage gptTariffPackage)
    {
        gptTariffPackage.setUpdateTime(DateUtils.getNowDate());
        return gptTariffPackageMapper.updateGptTariffPackage(gptTariffPackage);
    }

    /**
     * 批量删除package
     * 
     * @param ids 需要删除的package主键
     * @return 结果
     */
    @Override
    public int deleteGptTariffPackageByIds(Long[] ids)
    {
        return gptTariffPackageMapper.deleteGptTariffPackageByIds(ids);
    }

    /**
     * 删除package信息
     * 
     * @param id package主键
     * @return 结果
     */
    @Override
    public int deleteGptTariffPackageById(Long id)
    {
        return gptTariffPackageMapper.deleteGptTariffPackageById(id);
    }
}
